# lst = [10, 20, 30, 40, 50, 60, 70, 80]
# lst1 = lst[1:6]
# print(lst1)
#
# print(lst[3:7])
# print(lst[0:3:1])  # 步长默认为1
# print(lst[0:7:2])
# print(lst[1:6:3])  # 步长设置代表：n-1跳着取
# 切片开始和结束都可以不写，代表：从头开始和到尾结束
# print(lst[:])
# print(lst[2:])
# print(lst[:5])
# 当步长设置为-1的时，可以将列表数据反转
# print(lst[::-1])  # [80, 70, 60, 50, 40, 30, 20, 10]
# lst2 = ['a', 1, 'bb', 3.12, False, '1', 3]
# print(lst2[::-1])  # -1代表从右往左取值

# lst = [10, 20, 30, 40, 50, 60, 70, 80]
#
# print(lst[-2:-5])  # 默认取值从左到右取
# # 开始-结束一定需要有交集才会有值
#
# print(lst[-2:-5:-1])
